/* 
  封装持久化存储localstore对象
*/
// import Cookie from 'js-cookie';
const USER_KEY = 'token_store_key'
let Storage = sessionStorage;

/** 
 * 添加用户 
 **/
const SaveToken = (token) => {
    Storage.setItem(USER_KEY, token);
}

/**
*获取用户信息
*/
const GetToken = () => {
    const token =  Storage.getItem(USER_KEY);
    if(token){
        return token;
    }else{
        return null;
    }
}

/**
 * 删除用户信息
 */
const RemoveToken = ()=>{
    Storage.removeItem(USER_KEY);
}

export {SaveToken,GetToken,RemoveToken}